
var sum = [];
Ext.define('sheath.view.main.CaseLogGrid', {
    /* sheetGird必须必须继承 MTTECERP.view.aaSelfCtrl.grid.sheetGrid */
    extend: 'sheath.view.base.basegrid',
    /*这儿是自己对应的controller*/
    xtype: 'caseloggrid',
    requires: ['Ext.util.Collection', 'Ext.grid.plugin.Clipboard' ],  
    height: 200,
    plugins: 'clipboard',//自定义查询框
    initComponent: function () {
        /* 初始化 store */

        //extraParams: { param1: 1, param2: 2 },
        //url: 'http://localhost:8899/api/order/ext',
        //idProperty: 'indexid',

        Ext.apply(this, {
            store: Ext.create('sheath.store.CaseLogGrid'),
            listeners: {
                selectionchange: function (model, records, seletedGrid) {

                    if (records != 'undefined' && records.length > 0) {
                        var fm = [];
                        for (var i = 0; i <records.length; i++) { //循环每一行
                            fm[fm.length] = records[i].data.IndexID //fm就是你要的
                        }
                          sum = fm
                    } else {
                        console.log("测试")
                        sum = [];
                        console.log(sum)
                    }  
                    console.log(sum)
                }
            },
            columns:
                [
                 {
                     text: '姓名',
                     flex: 1,
                    filter: {
                          type: 'string'
                      },
                     dataIndex: 'userName'
                 },             
                 {
                     text: '行为',
                     flex: 1,
                     filter: {
                          type: 'string'
                      },
                     dataIndex: 'operation',
                     filter: true
                 },
                  {
                      text: '时间',
                      flex: 1,
                      filter: {
                          type: 'string'
                      },
                      dataIndex: 'actTime',
                      filter: true
                  }
                ],         
        });
        this.callParent();
    },

});